Update dependency keras to v3 [SECURITY] #628
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs from Renovate will soon appear from 'Mend'. Learn more here.
This PR contains the following updates:
==2.8.0->==3.11.0Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub Vulnerability Alerts
CVE-2024-3660
A arbitrary code injection vulnerability in TensorFlow's Keras framework (<2.13) allows attackers to execute arbitrary code with the same permissions as the application using a model that allow arbitrary code irrespective of the application.
CVE-2025-9906
Arbitrary Code Execution in Keras
Keras versions prior to 3.11.0 allow for arbitrary code execution when loading a crafted
.kerasmodel archive, even whensafe_mode=True.The issue arises because the archive’s
config.jsonis parsed before layer deserialization. This can invokekeras.config.enable_unsafe_deserialization(), effectively disabling safe mode from within the loading process itself. An attacker can place this call first in the archive and then include aLambdalayer whose function is deserialized from a pickle, leading to the execution of attacker-controlled Python code as soon as a victim loads the model file.Exploitation requires a user to open an untrusted model; no additional privileges are needed. The fix in version 3.11.0 enforces safe-mode semantics before reading any user-controlled configuration and prevents the toggling of unsafe deserialization via the config file.
Affected versions: < 3.11.0
Patched version: 3.11.0
It is recommended to upgrade to version 3.11.0 or later and to avoid opening untrusted model files.
Release Notes
keras-team/keras (keras)
v3.11.0: Keras 3.11.0Compare Source
What's Changed
fit()/evaluate()/predict().keras.ops.kaiserfunction.keras.ops.hanningfunction.keras.ops.cbrtfunction.keras.ops.deg2radfunction.keras.ops.layer_normalizationfunction to leverage backend-specific performance optimizations.Backend-specific changes
JAX backend
TensorFlow backend
Flattenlayer.OpenVINO backend
New Contributors
Full Changelog: keras-team/keras@v3.10.0...v3.11.0
v3.10.0: Keras 3.10.0Compare Source
New features
model.save(). It is controlled via themax_shard_sizeargument. Specifying this argument will split your Keras model weight file into chunks of this size at most. Useload_model()to reload the sharded files.keras.optimizers.Muonkeras.layers.RandomElasticTransformkeras.losses.CategoricalGeneralizedCrossEntropy(with functional versionkeras.losses.categorical_generalized_cross_entropy)axisargument toSparseCategoricalCrossentropylora_alphato all LoRA-enabled layers. If set, this parameter scales the low-rank adaptation delta during the forward pass.keras.activations.sparse_sigmoidkeras.ops.image.elastic_transformkeras.ops.anglekeras.ops.bartlettkeras.ops.blackmankeras.ops.hammingkeras.ops.view_as_complex,keras.ops.view_as_realPyTorch backend
TensorFlow backend
tf.RaggedTensorsupport toEmbeddinglayersynchronizationargumentOpenVINO backend
New Contributors
Full Changelog: keras-team/keras@v3.9.0...v3.10.0
v3.9.2: Keras 3.9.2Compare Source
What's Changed
Full Changelog: keras-team/keras@v3.9.1...v3.9.2
v3.9.1: Keras 3.9.1Compare Source
What's Changed
Full Changelog: keras-team/keras@v3.9.0...v3.9.1
v3.9.0: Keras 3.9.0Compare Source
New features
keras.RematScopeandkeras.remat. It can be used to turn on rematerizaliation for certain layers in fine-grained manner, e.g. only for layers larger than a certain size, or for a specific set of layers, or only for activations.keras.ops.rot90keras.ops.rearrange(Einops-style)keras.ops.signbitkeras.ops.polarkeras.ops.image.perspective_transformkeras.ops.image.gaussian_blurkeras.layers.RMSNormalizationkeras.layers.AugMixkeras.layers.CutMixkeras.layers.RandomInvertkeras.layers.RandomErasingkeras.layers.RandomGaussianBlurkeras.layers.RandomPerspectivedtypeargument toJaxLayerandFlaxLayerlayersBinaryAccuracymetricantialiasargument tokeras.layers.Resizinglayer.npzmodel files (numpy format). Thanks to Peng Zhou for reporting the vulnerability.New Contributors
Full Changelog: keras-team/keras@v3.8.0...v3.9.0
v3.8.0: Keras 3.8.0Compare Source
New: OpenVINO backend
OpenVINO is now available as an infererence-only Keras backend. You can start using it by setting the
backendfield to"openvino"in yourkeras.jsonconfig file.OpenVINO is a deep learning inference-only framework tailored for CPU (x86, ARM), certain GPUs (OpenCL capable, integrated and discrete) and certain AI accelerators (Intel NPU).
Because OpenVINO does not support gradients, you cannot use it for training (e.g.
model.fit()) -- only inference. You can train your models with the JAX/TensorFlow/PyTorch backends, and when trained, reload them with the OpenVINO backend for inference on a target device supported by OpenVINO.New: ONNX model export
You can now export your Keras models to the ONNX format from the JAX, TensorFlow, and PyTorch backends.
Just pass
format="onnx"in yourmodel.export()call:New: Scikit-Learn API compatibility interface
It's now possible to easily integrate Keras models into Sciki-Learn pipelines! The following wrapper classes are available:
keras.wrappers.SKLearnClassifier: implements the sklearnClassifierAPIkeras.wrappers.SKLearnRegressor: implements the sklearnRegressorAPIkeras.wrappers.SKLearnTransformer: implements the sklearnTransformerAPIOther feature additions
keras.ops.diagflatkeras.ops.unravel_indexsparse_plusactivationsparsemaxactivationkeras.layers.RandAugmentkeras.layers.Equalizationkeras.layers.MixUpkeras.layers.RandomHuekeras.layers.RandomGrayscalekeras.layers.RandomSaturationkeras.layers.RandomColorJitterkeras.layers.RandomColorDegenerationkeras.layers.RandomSharpnesskeras.layers.RandomShearaxistotverskylossJAX specific changes
TensorFlow specific changes
keras.random.shuffleXLA compilablePyTorch specific changes
model.export()andkeras.export.ExportArchivewith the PyTorch backend, supporting both the TF SavedModel format and the ONNX format.New Contributors
Full Changelog: keras-team/keras@v3.7.0...v3.8.0
v3.7.0: Keras 3.7.0Compare Source
API changes
flash_attentionargument tokeras.ops.dot_product_attentionand tokeras.layers.MultiHeadAttention.keras.layers.STFTSpectrogramlayer (to extract STFT spectrograms from inputs as a preprocessing step) as well as its initializerkeras.initializers.STFTInitializer.celu,glu,log_sigmoid,hard_tanh,hard_shrink,squareplusactivations.keras.losses.Circleloss.keras.visualization.draw_bounding_boxes,keras.visualization.draw_segmentation_masks,keras.visualization.plot_image_gallery,keras.visualization.plot_segmentation_mask_gallery.double_checkpointargument toBackupAndRestoreto save a fallback checkpoint in case the first checkpoint gets corrupted.CenterCrop,RandomFlip,RandomZoom,RandomTranslation,RandomCrop.keras.ops.exp2,keras.ops.inneroperations.Performance improvements
bias_add.New Contributors
Full Changelog: keras-team/keras@v3.6.0...v3.7.0
v3.6.0: Keras 3.6.0Compare Source
Highlights
keras.saving.KerasFileEditor. Use it to inspect, diff, modify and resave Keras weights files. See basic workflow here.keras.utils.Configclass for managing experiment config parameters.BREAKING changes
keras.utils.get_file, withextract=Trueoruntar=True, the return value will be the path of the extracted directory, rather than the path of the archive.Other changes and additions
fit(),evaluate(),predict(). This enables 100% compact stacking oftrain_stepcalls on accelerators (e.g. when running small models on TPU).on_batch_end, this will disable async logging. You can force it back by addingself.async_safe = Trueto your callbacks. Note that theTensorBoardcallback isn't considered async safe by default. Default callbacks like the progress bar are async safe.keras.saving.KerasFileEditorutility to inspect, diff, modify and resave Keras weights file.keras.utils.Configclass. It behaves like a dictionary, with a few nice features:config.foo = 2orconfig["foo"]are both valid)config.to_json().config.freeze().bitwise_andbitwise_invertbitwise_left_shiftbitwise_notbitwise_orbitwise_right_shiftbitwise_xorkeras.ops.logdet.keras.ops.trunc.keras.ops.dot_product_attention.keras.ops.histogram.PyDatasetinstances to use multithreading.verboseinkeras.saving.ExportArchive.write_out()method for exporting TF SavedModel.epsilonargument inkeras.ops.normalize.Model.get_state_tree()method for retrieving a nested dict mapping variable paths to variable values (either as numpy arrays or backend tensors (default)). This is useful for rolling out custom JAX training loops.keras.layers.AutoContrast,keras.layers.Solarization.keras.layers.Pipelineclass, to apply a sequence of layers to an input. This class is useful to build a preprocessing pipeline. Compared to aSequentialmodel,Pipelinefeatures a few important differences:Model, just a plain layer.tf.data, the pipeline will also remaintf.datacompatible, independently of the backend you use.New Contributors
Full Changelog: keras-team/keras@v3.5.0...v3.6.0
v3.5.0: Keras 3.5.0Compare Source
What's Changed
keras.Model.save()and load.kerasmodels directly from Hugging Face Hub withkeras.saving.load_model().keras.optimizers.Lamboptimizer.keras.distributionAPI support for very large models.keras.ops.associative_scanop.keras.ops.searchsortedop.keras.utils.PyDataset.on_epoch_begin()method.data_formatargument tokeras.layers.ZeroPadding1Dlayer.Full Changelog: keras-team/keras@v3.4.1...v3.5.0
v3.4.1: Keras 3.4.1Compare Source
This is a minor bugfix release.
v3.4.0: Keras 3.4.0Compare Source
Highlights
keras.dtype_policies.DTypePolicyMapfor easy configuration of dtype policies of nested sublayers of a subclassed layer/model.keras.ops.argpartitionkeras.ops.scankeras.ops.lstsqkeras.ops.switchkeras.ops.dtypekeras.ops.mapkeras.ops.image.rgb_to_hsvkeras.ops.image.hsv_to_rgbWhat's changed
float8inference forDenseandEinsumDenselayers.nameargument in all Keras Applications models.axisargument inkeras.losses.Dice.keras.utils.FeatureSpaceto be used in atf.datapipeline even when the backend isn't TensorFlow.StringLookuplayer can now taketf.SparseTensoras input.Metric.variablesis now recursive.trainingargument toModel.compute_loss().dtypeargument to all losses.keras.utils.split_datasetnow supports nested structures in dataset.Full Changelog: keras-team/keras@v3.3.3...v3.4.0
v3.3.3: Keras 3.3.3Compare Source
This is a minor bugfix release.
v3.3.2: Keras 3.3.2Compare Source
This is a simple fix release that re-surfaces legacy Keras 2 APIs that aren't part of Keras package proper, but that are still featured in
tf.keras. No other content has changed.v3.3.1: Keras 3.3.1Compare Source
This is a simple fix release that moves the legacy
_tf_kerasAPI directory to the root of the Keras pip package. This is done in order to preserve import paths likefrom tensorflow.keras import layerswithout making any changes to the TensorFlow API files.No other content has changed.
v3.3.0: Keras 3.3.0Compare Source
What's Changed
keras.ops.ctc_decodefor JAX and TensorFlow.keras.ops.vectorize,keras.ops.select.keras.ops.image.rgb_to_grayscale.keras.losses.Tverskyloss.bincountanddigitizesparse support.In addition, the codebase structure has evolved:
keras/src/.keras/api/.pip installKeras directly from the GitHub sources.New Contributors
Full Changelog: keras-team/keras@v3.2.1...v3.3.0
v3.2.1: Keras 3.2.1Compare Source
What's Changed
This is a minor bugfix release.
Full Changelog: keras-team/keras@v3.2.0...v3.2.1
v3.2.0: Keras 3.2.0Compare Source
What changed
DenseandEinsumDenselayers (thereby any LLM) in int8 precision.keras.ops.custom_gradientsupport to PyTorch.keras.layers.JaxLayerandkeras.layers.FlaxLayerto wrap JAX/Flax modules as Keras layers.save_model&load_modelto accept a file-like object.Embeddinglayer.compute_lossmethod with all backends.self.lossesinside a customcompute_lossmethod with the JAX backend.keras.losses.Diceloss.keras.ops.correlate.model.export(): add support for aliases, finer control overjax2tfoptions, and dynamic batch shapes.New Contributors
Full Changelog: keras-team/keras@v3.1.1...v3.2.0
v3.1.1: Keras 3.1.1Compare Source
This is a minor bugfix release over 3.1.0.
What's Changed
draw_seedcausing device discrepancy issue duringtorch's symbolic execution by @KhawajaAbaid in #19289keras.ops.softmaxfor the tensorflow backend by @tirthasheshpatel in #19300scatter_updatein optimizers. by @hertschuh in #19313dm-treewithoptreeby @james77777778 in #19306tf.Datasets to have different dimensions. by @hertschuh in #19318New Contributors
Full Changelog: keras-team/keras@v3.1.0...v3.1.1
v3.1.0: Keras 3.1.0Compare Source
New features
int8inference. Just callmodel.quantize("int8")to do an in-place conversion of a bfloat16 or float32 model to an int8 model. Note that onlyDenseandEinsumDenselayers will be converted (this covers LLMs and all Transformers in general). We may add more supported layers over time.keras.config.set_backend(backend)utility to reload a different backend.keras.layers.MelSpectrogramlayer for turning raw audio data into Mel spectrogram representation.keras.ops.custom_gradientdecorator (only for JAX and TensorFlow).keras.ops.image.crop_images.pad_to_aspect_ratioargument toimage_dataset_from_directory.keras.random.binomialandkeras.random.betafunctions.keras.ops.einsumto run with int8 x int8 inputs and int32 output.verboseargument in all dataset-creation utilities.Notable fixes
SpectralNormalizationaxislogic across all backends and add support for multiple axes inexpand_dimsandsqueezeNew Contributors
Full Changelog: keras-team/keras@v3.0.5...v3.1.0
v3.0.5: Keras 3.0.5Compare Source
This release brings many bug fixes and performance improvements, new linear algebra ops, and sparse tensor support for the JAX backend.
Highlights
keras.ops.linalg.while_loopop.erfinvop.normalizeop.IterableDatasettoTorchDataLoaderAdapter.New Contributors
Full Changelog: keras-team/keras@v3.0.4...v3.0.5
v3.0.4: Keras 3.0.4Compare Source
This is a minor release with improvements to the LoRA API required by the next release of KerasNLP.
Full Changelog: keras-team/keras@v3.0.3...v3.0.4
v3.0.3: Keras 3.0.3 releaseCompare Source
This is a minor Keras release.
What's Changed
Dense,EinsumDense,Embedding).SwapEMAWeightscallback to make it easier to evaluate model metrics using EMA weights during training.DataAdaptersnow create a native iterator for each backend, improving performance.bfloat16dtype is now allowed in the globalset_dtypeconfiguration utility.New Contributors
Full Changelog: keras-team/keras@v3.0.2...v3.0.3
v3.0.2: Keras 3.0.2Compare Source
Breaking changes
There are no known breaking changes in this release compared to 3.0.1.
API changes
keras.random.binomialandkeras.random.betaRNG functions.BatchNormalization.keras.losses.CTC(loss function for sequence-to-sequence tasks) as well as the lower-level operationkeras.ops.ctc_loss.ops.random.alpha_dropoutandlayers.AlphaDropout.Full Changelog: keras-team/keras@v3.0.1...v3.0.2
v3.0.1: Keras 3.0.1Compare Source
This is a minor release focused on bug fixes and performance improvements.
What's Changed
stop_evaluatingandstop_predictingmodel attributes for callbacks, similar tostop_training.keras.device()scope for managing device placement in a multi-backend way.PyDataset.hard_swishactivation and op.force_downloadarg toget_fileto force cache invalidation.Full Changelog: keras-team/keras@v3.0.0...v3.0.1
v3.0.0: Keras 3.0.0Compare Source
Major updates
See the release announcement for a detailed list of major changes. Main highlights compared to Keras 2 are:
keras.opsAPI for building cross-framework components.keras.distributionbased on JAX.Breaking changes
See this thread for a complete list of breaking changes, as well as the Keras 3 migration guide.
v2.15.0: Keras Release 2.15.0Compare Source
What's Changed
StringLookupdocumentation by @cw118 in #18333compile_from_config(). by @nkovela1 in #18492New Contributors
Full Changelog: keras-team/keras@v2.14.0...v2.15.0
v2.14.0: Keras Release 2.14.0Compare Source
What's Changed
is Nonechecks onmeasure_performanceby @SamuelMarks in #17980Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.